home *** CD-ROM | disk | FTP | other *** search
/ You're the Director / You're The Director.iso / mac / MACF / MGER.DIR / 00012_Script_Quicktime < prev    next >
Text File  |  1995-10-10  |  11KB  |  369 lines

  1. --  QTMovie OpenMovie, <window type or wdef id>, <file name>, <location or rect>, initial options...
  2. --  QTMovie OpenMovie, Direct, <file name>, <location or rect>, initial options...
  3. --  QTMovie Direct, <movieID>, command
  4. --  QTMovie Direct, <movieID>, Get, <property name>
  5. --  QTMovie Direct, <movieID>, Set, <property name>, <property value>
  6. --
  7. --Initial options: loop, palindrome, mute, invisible, nocontroller, paused, closeOnFinish, showPoster,
  8. --        clipTo <,rect>, loadIntoRAM, seeAllFrames, dontPaintWhite, badge, fastIdle,  directWindow <,title>,
  9. --                       MovieWDEF only options: cmdKeyDraggable, borderWidth
  10. --
  11. --commands: play, pause, reverse, stepFwd, stepRev, copyFrame, copyPoster, 
  12. --                  showController, hideController, loadSegIntoRAM, showPoster, idle, and more
  13. --
  14. --properties: windowLoc, windowRect, movieRect, movieLoc, bitMapClip, clipRect, currTime, audioLevel,
  15. --                  visible, rate, movieScale, windowName, windowCloseMsg, mouseDownMsg, cursorMsg,     
  16. --                  timedCallBack, seeAllFrames, duration, fileSize, replaceMovie, hasController, segmentPlay, 
  17. --                  segmentEnd, segmentStart, foreColor, backColor, badge, loop, palindrome, and more
  18.  
  19.  
  20.  
  21. -- Main command to load and play movie
  22. -- can be modified using any of the above command structures
  23. -- e.g. loadintoRAM: loads movie into RAM, clipto: fast crop of movie, etc.
  24.  
  25. on playQT Name, Loc, fullscreen
  26.   global movieID, QTEnd
  27.   if length(movieID)=0 then put QTMovie ("OpenMovie","Direct",the pathname&string(name), string(Loc),"closedOnFinish", "fastIdle") into movieID 
  28.   
  29.   if movieID contains "error" then 
  30.     put movieID
  31.     beep
  32.   end if
  33.   
  34.   put QTMovie("Direct", movieID, "Get", "duration") into QTEnd
  35.   
  36.   QTMovie("Direct", movieID, "set", "currTime",0)
  37.   
  38.   --this line shows how to blow up any movie to a full 640x480 screen
  39.   if fullscreen=1 then QTMovie("Direct", movieID, "Set","MovieRect","0, 0, 640, 480")
  40.   
  41.   repeat while (value(QTMovie("Direct", movieID, "Get", "currTime")) < value(QTEnd))
  42.     QTMovie("Direct",movieID,"Idle")
  43.   end repeat
  44.   
  45.   stopQT
  46. end playqt
  47.  
  48. on playQTP Name, Loc, fullscreen
  49.   global movieID, QTEnd,fullscreenG,LowBnd,LastFrame
  50.   -- This plays QT for preview
  51.   
  52.   --the pathname&
  53.   if length(movieID)=0 then put QTMovie ("OpenMovie","Direct",string(name), string(Loc),"closedOnFinish", "fastIdle") into movieID 
  54.   
  55.   if movieID contains "error" then 
  56.     put "inside error"
  57.     put movieID
  58.     beep
  59.   end if
  60.   
  61.   put QTMovie("Direct", movieID, "Get", "duration") into QTEnd
  62.   
  63.   QTMovie("Direct", movieID, "set", "currTime",0)
  64.   
  65.   
  66.   --this line shows how to blow up any movie to a full 640x480 screen
  67.   if fullscreen=1 then QTMovie("Direct", movieID, "Set","MovieRect","0, 0, 320, 240")
  68.   else QTMovie("Direct", movieID, "Set","MovieRect","160, 140, 480, 380")
  69.   set LowBnd = -1
  70.   put "after LowBnd"
  71.   QTMovie("Direct",movieID,"play")
  72.   put "after play"
  73.   put "movieID",movieID
  74.   repeat while (value(QTMovie("Direct", movieID, "Get", "currTime")) < value(QTEnd) and ¼
  75. value(QTMovie("Direct", movieID, "Get", "currTime")) > LowBnd)
  76.     put "Above play Prvw"
  77.     --updateStage
  78.     --QTMovie("Direct",movieID,"Idle")
  79.     --updatestage
  80.     play "F3"
  81.     --play 106
  82.   end repeat
  83.   
  84.   stopQT
  85.   put "after stopQT"
  86.   go LastFrame
  87.   
  88.   --put "after play prvw"
  89.   --QTMovie("Direct",movieID,"Idle")
  90.   
  91. end playqtp
  92.  
  93. on playQTF Name, Loc, fullscreen
  94.   global movieID, QTEnd,fullscreenG,LowBnd,Current,LastFrame,CurrentAudio,Clips,gSpeed
  95.   -- This plays QT for whole film
  96.   --if length(movieID)=0 then 
  97.   put QTMovie ("OpenMovie","Direct",string(name), string(Loc),"closedOnFinish", "fastIdle") into movieID 
  98.   
  99.   if movieID contains "error" then 
  100.     put "inside error"
  101.     put movieID
  102.     beep
  103.   end if
  104.   
  105.   put QTMovie("Direct", movieID, "Get", "duration") into QTEnd
  106.   
  107.   QTMovie("Direct", movieID, "set", "currTime",0)
  108.   
  109.   put string(CurrentAudio) into CurrentAudio
  110.   QTMovie("Direct",movieID,"Set","audioLevel",CurrentAudio)
  111.   
  112.   --this line shows how to blow up any movie to a full 640x480 screen
  113.   if fullscreen=1 then QTMovie("Direct", movieID, "Set","MovieRect","0, 0, 640, 480")
  114.   else QTMovie("Direct", movieID, "Set","MovieRect","160, 140, 480, 380")
  115.   
  116.   set LowBnd = -1
  117.   QTMovie("Direct",movieID,"play")
  118.   
  119.   if gSpeed = 2 then Forward
  120.   
  121.   repeat while (value(QTMovie("Direct", movieID, "Get", "currTime")) < value(QTEnd) and ¼
  122. value(QTMovie("Direct", movieID, "Get", "currTime")) > LowBnd)
  123.     if Current = TRUE then
  124.       play "F2"
  125.     else if Current = 0 then
  126.       play "F3"
  127.     else
  128.       play "F4"
  129.     end if
  130.   end repeat
  131.   
  132.   if Current = 0 then
  133.     if fullscreenG=1 then
  134.       ChangeScreenSize Clips, "160,140",0
  135.     end if
  136.   end if
  137.   
  138.   updateStage
  139.   stopQT
  140.   if Current = TRUE then
  141.     go 19
  142.   else if Current = 0 then    
  143.     repeat with x = 13 to 17
  144.       puppetSprite x,TRUE
  145.       set the visible of sprite x to TRUE
  146.       puppetSprite x,FALSE
  147.     end repeat
  148.     puppetSprite 19,TRUE
  149.     set the visible of sprite 19 to FALSE
  150.     go (LastFrame-1)
  151.     
  152.     repeat with x = 3 to 7
  153.       puppetSprite x,TRUE
  154.       set the visible of sprite x to TRUE
  155.       puppetSprite x,FALSE
  156.     end repeat
  157.     set MovieSeq = FALSE
  158.     setbar
  159.     updateStage
  160.   else
  161.     if fullscreenG=1 then
  162.       ChangeScreenSize Clips, "160,140",0
  163.     end if
  164.     go "Intro"
  165.   end if
  166.   
  167. end 
  168.  
  169. -- closes the movie and flushes RAM used by movie object
  170. on stopQT
  171.   global movieID,LastButton
  172.   QTMovie("Direct",movieID,"Dispose")
  173.   put "" into movieID
  174.   set LastButton = 0
  175. end
  176.  
  177. on stopQTP
  178.   global movieID,LastButton
  179.   QTMovie("Direct",movieID,"Dispose")
  180.   put "" into movieID
  181.   set LastButton = 0
  182. end
  183.  
  184. -- This command must be placed in any repeating loop to continue movie playback
  185. --you can integrate other commands into a loop to add interactivity while the movie
  186. --is playing
  187. on IdleQT
  188.   global movieID,QTend
  189.   QTMovie("Direct",movieID,"Idle")
  190.   if value(QTMovie("Direct", movieID, "Get", "currTime")) >= value(QTEnd) then stopQT
  191. end
  192.  
  193. on pauseQT
  194.   global movieID,LastButton
  195.   put "inside pauseQT"
  196.   QTMovie("Direct",movieID,"pause")
  197.   set LastButton = 1
  198. end
  199.  
  200. on unpauseQT
  201.   global movieID
  202.   put "unpauseQT"
  203.   QTMovie("Direct",movieID,"play")
  204.   
  205. end
  206.  
  207. on restartQT Name, Loc, fullscreen
  208.   global movieID, QTEnd
  209.   put "inside restart QT"
  210.   if length(movieID)=0 then put QTMovie ("OpenMovie","Direct",the pathname&string(name), string(Loc),"closedOnFinish", "fastIdle") into movieID 
  211.   
  212.   if movieID contains "error" then 
  213.     put movieID
  214.     beep
  215.   end if
  216.   
  217.   put QTMovie("Direct", movieID, "Get", "duration") into QTEnd
  218.   
  219.   --QTMovie("Direct", movieID, "set", "currTime",0)
  220.   
  221.   --this line shows how to blow up any movie to a full 640x480 screen
  222.   if fullscreen=1 then QTMovie("Direct", movieID, "Set","MovieRect","0, 0, 640, 480")
  223.   
  224.   repeat while (value(QTMovie("Direct", movieID, "Get", "currTime")) < value(QTEnd))
  225.     QTMovie("Direct",movieID,"Idle")
  226.   end repeat
  227.   
  228.   stopQT
  229. end restartqt
  230.  
  231. on Rewind
  232.   global movieID,gRewind,LowBnd
  233.   if (gRewind = 0) then
  234.     QTMovie("Direct",movieID,"reverse")
  235.     set gRewind = 1
  236.     set LowBnd = 0
  237.   end if
  238. end
  239.  
  240. on Forward
  241.   global movieID,gRewind,gSpeed,LastButton
  242.   put "inside Forward"
  243.   if (gRewind = 1) then
  244.     QTMovie("Direct",movieID,"reverse")
  245.     set gRewind = 0
  246.   end if
  247.   set speed = 2.0
  248.   put string(speed) into speed
  249.   QTMovie("Direct",movieID,"Set","rate",speed)
  250.   set gSpeed = 2
  251.   set LastButton = 1
  252. end
  253.  
  254. on ChangeScreenSize Name, Loc, Type
  255.   global fullscreenG,movieID,QTEnd,gRewind,gSpeed,CurrentAudio
  256.   
  257.   if fullscreenG=0 then
  258.     --puppetSprite 1,TRUE
  259.     --set the moveableSprite of sprite 1 to TRUE
  260.     --put the locV of sprite 1 into Current
  261.     --set Current = Current-1
  262.     --set the locV of sprite 1 to Current
  263.     
  264.     --updateStage
  265.     --set the visible of sprite 48 to TRUE
  266.     --put "just before pauseQT"
  267.     --pauseQT
  268.     if Type = 1 then 
  269.       puppetSprite 48,TRUE
  270.       set the visibility of sprite 48 to TRUE
  271.       set the moveableSprite of sprite 48 to TRUE
  272.       UNLOADCAST
  273.       QTMovie("Direct", movieID, "Set","MovieRect","0, 0, 640, 480")
  274.       
  275.       --updateSTage
  276.       --set the locv of sprite 48 to the locv of sprite 48 +1
  277.       --puppetSprite 48,FALSE
  278.       updateStage
  279.     end if
  280.     
  281.     QTMovie("Direct", movieID, "Set","MovieRect","0, 0, 640, 480")
  282.     --unpauseQT
  283.     updateStage
  284.     set fullscreenG=1
  285.     --set the visible of sprite 48 to FALSE
  286.   else 
  287.     -- puppetSprite 48,TRUE
  288.     --set the visible of sprite 48 to false
  289.     
  290.     set gRewind = 0
  291.     --pauseQT
  292.     if Type = 1 then
  293.       puppetSprite 48,TRUE
  294.       set the moveableSprite of sprite 48 to TRUE
  295.       set the locv of sprite 48 to the locv of sprite 48 +1
  296.       set the visibility of sprite 48 to FALSE
  297.     end if
  298.     
  299.     put QTMovie("Direct", movieID, "Get","currTime") into CTime
  300.     QTMovie("Direct", movieID, "Dispose")
  301.     --put "" into movieID
  302.     UNLOADCAST
  303.     --puppetSprite 1,TRUE
  304.     --set the moveableSprite of sprite 1 to TRUE
  305.     --put the locV of sprite 1 into Current
  306.     -- set Current = Current+1
  307.     -- set the locV of sprite 1 to Current
  308.     put QTMovie ("OpenMovie","Direct",string(name), string(Loc),"closedOnFinish", "fastIdle") into movieID 
  309.     
  310.     if movieID contains "error" then 
  311.       put movieID
  312.       beep
  313.     end if
  314.     
  315.     put QTMovie("Direct", movieID, "Get", "duration") into QTEnd
  316.     QTMovie("Direct", movieID, "set", "currTime",CTime)
  317.     put string(CurrentAudio) into CurrentAudio
  318.     QTMovie("Direct",movieID,"Set","audioLevel",CurrentAudio)
  319.     
  320.     QTMovie("Direct", movieID, "Set","MovieRect","160, 140, 480, 380")
  321.     updateStage
  322.     --puppetSprite 1,FALSE
  323.     
  324.     if gSpeed = 2 then
  325.       set speed = 2.0
  326.       put string(speed) into speed
  327.       QTMovie("Direct",movieID,"Set","rate",speed) 
  328.     end if
  329.     
  330.     set fullscreenG=0
  331.     --unpauseQT
  332.     updateStage
  333.   end if
  334.   
  335. end
  336.  
  337.  
  338.  
  339. on IncreaseVol
  340.   global movieID,CurrentAudio
  341.   put "CurrentAudio",CurrentAudio
  342.   put QTMovie("Direct",movieID,"Get","audioLevel") into CurrentAudio
  343.   if (CurrentAudio <255) then
  344.     set CurrentAudio = CurrentAudio + 30
  345.   end if
  346.   put integer(CurrentAudio) into CurrentAudio
  347.   put string(CurrentAudio) into CurrentAudio
  348.   pauseQT
  349.   QTMovie("Direct",movieID,"Set","audioLevel",CurrentAudio)
  350.   unpauseQT
  351. end
  352.  
  353. on DecreaseVol
  354.   global movieID,CurrentAudio
  355.   put QTMovie("Direct",movieID,"Get","audioLevel") into CurrentAudio
  356.   put "decreaseVol"
  357.   put "CurrentAudio",CurrentAudio
  358.   if (CurrentAudio >50) then
  359.     set CurrentAudio = CurrentAudio - 50
  360.   else
  361.     set CurrentAudio = 0
  362.   end if
  363.   put integer(CurrentAudio) into CurrentAudio
  364.   put string(CurrentAudio) into CurrentAudio
  365.   pauseQT
  366.   QTMovie("Direct",movieID,"Set","audioLevel",CurrentAudio)
  367.   unpauseQT
  368. end
  369.